import { NavBar } from 'react-vant';
import React from 'react'
import { ArrowLeft } from '@react-vant/icons';
import { useNavigate } from 'react-router-dom';

export default function Header() {

    let navigate = useNavigate()

    return (
        <div>
            <NavBar
                title="标题"
                leftText={<ArrowLeft />}
                rightText="我的"
                /* 返回上一页 */
                onClickLeft={() => {
                    navigate(-1)
                 }}
                /* 跳转我的 */
                onClickRight={() => {
                    navigate('/my')
                 }}
            />
        </div>
    )
}


